UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QHEz53YdEruFhInX2c3I+IJL8vKPTby4BiIypmaI4To='
WHERE
key_id = '1dee69f1c61f49a3a6f092b2fff4447f15297ec13df28dd7ced26e596f8c1c39'
AND (
token = 'QHEz53YdEruFhInX2c3I+IJL8vKPTby4BiIypmaI4To='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)