UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aOIzzkAEIQiPvOCAXgmwD5Ti5EIx2QiczUuDnS66zOE='
WHERE
key_id = '68b8c62763646919da7b8ff2b808df8af85d0277eef582acb53efb459c23ea6c'
AND (
token = 'aOIzzkAEIQiPvOCAXgmwD5Ti5EIx2QiczUuDnS66zOE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)