UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7p69BPMrL4kRPHYWTctfTzJHu+Bdqmmh8vGEiO2ufgo='
WHERE
key_id = 'ec8661ccb3dd29fee69177848d20b6b432e2e6b8eab18defb46addd22d3705d1'
AND (
token = '7p69BPMrL4kRPHYWTctfTzJHu+Bdqmmh8vGEiO2ufgo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)