UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QaLbzEcDlTGZiR2U0v7B1O9zYOWQpASnjAE+bqrt16Q='
WHERE
key_id = '5b5eb75839224ba10b682fe32f2a04d151f66f892ac88e159996d737256cfe0d'
AND (
token = 'QaLbzEcDlTGZiR2U0v7B1O9zYOWQpASnjAE+bqrt16Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)