UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Tf7CS8hVptZPcrBkiQb9vUmHp/e0FEQpQMkEqgdDX84='
WHERE
key_id = 'fa3b1d2d3314eacf7d6f893f63d6310f3398b144443acc880eeaf520941f853c'
AND (
token = 'Tf7CS8hVptZPcrBkiQb9vUmHp/e0FEQpQMkEqgdDX84='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)