UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RlCGG/PJerwHSphECLKK3Qx2dNp0zqjBVQqNDd/t0+E='
WHERE
key_id = 'ff50200b62ac9c23b1c63917791e79f7b9003cc7fd08e6fbcf469516f782571f'
AND (
token = 'RlCGG/PJerwHSphECLKK3Qx2dNp0zqjBVQqNDd/t0+E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)