UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'q0VIiasNt/RYuYXxDMG2Yu77Z3s+jM7KzkmjKJY/2Z8='
WHERE
key_id = 'eae44b05798aef0057b1dc976cb8885841d411c57234307753f464d8bbec1d71'
AND (
token = 'q0VIiasNt/RYuYXxDMG2Yu77Z3s+jM7KzkmjKJY/2Z8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)