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