UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1XqYojTeJIDqDVdwznDInza9e3KJmwNOEPudQ509oQQ='
WHERE
key_id = 'fa8b776fec55eddf94c089bbc9417283d97ca7061d75fdf6bbb762726c9e26d9'
AND (
token = '1XqYojTeJIDqDVdwznDInza9e3KJmwNOEPudQ509oQQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)