UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fGVTX/Ir4KT/kMDl+chB/uWq+SoU7wmKb7/x8UOBeh4='
WHERE
key_id = '76c580306286bc4dca30c54c6d42ed01b1c84422c2961f038b56f946c46e0574'
AND (
token = 'fGVTX/Ir4KT/kMDl+chB/uWq+SoU7wmKb7/x8UOBeh4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)