UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9BOKpG5sOWSAxTEEQAFp7kgUGPvRIJOBWDp5jrHh4rQ='
WHERE
key_id = 'e19380580b89343d98dda4f241e122a805e5a4f0f7f812a9430be79a343faf7b'
AND (
token = '9BOKpG5sOWSAxTEEQAFp7kgUGPvRIJOBWDp5jrHh4rQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)