UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6k5KPaudIxD+n488tVP2KAEAXfHdk9BDNSGIHqH2gko='
WHERE
key_id = '68288c62a486401ac91b0487accd323371fa0d32a20ed6eb4244f85cba06be9d'
AND (
token = '6k5KPaudIxD+n488tVP2KAEAXfHdk9BDNSGIHqH2gko='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)