UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aRqK4UhPj48T83Exb5bpGU89u29WGimTu3gatjuDwrg='
WHERE
key_id = '04c191baab089c8dd071c6b9a0c61dd18ee4a206d170ba5c2c61559766c4ff5a'
AND (
token = 'aRqK4UhPj48T83Exb5bpGU89u29WGimTu3gatjuDwrg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)