UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VtMsGgJHkWLewJG2nPYBVSTJtuGwClpBE7ZP+faQcls='
WHERE
key_id = '4f7b074e07e62b472ecc1c2aaa8d84f0a1e368de8b8d96392be87489d403f240'
AND (
token = 'VtMsGgJHkWLewJG2nPYBVSTJtuGwClpBE7ZP+faQcls='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)