UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OEVXk/SxoKpM4wqzYwAtxe/GN5yD4mhUgOL6KVpFGBw='
WHERE
key_id = '95e8783ac29f1e48652906a3818b30138e0ec97021ee1e6da406cc070eae0603'
AND (
token = 'OEVXk/SxoKpM4wqzYwAtxe/GN5yD4mhUgOL6KVpFGBw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)