UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TL/zZ246cZZRFz3H/ne1ZvGkot3J/OaJQpM6A3/C1RE='
WHERE
key_id = 'c9de5aaa5201ee177388a768c4766aa29204b9bec24126f077073a746dfa6111'
AND (
token = 'TL/zZ246cZZRFz3H/ne1ZvGkot3J/OaJQpM6A3/C1RE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)