UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9u9bBZDH9VJC9z2UBUslbtZ3V/DrgO2OzEQ9ekxV0X0='
WHERE
key_id = '338653c548dc654ed242a8c17a9f28ec52d922e5bd00ebb9dcdd736224adfd62'
AND (
token = '9u9bBZDH9VJC9z2UBUslbtZ3V/DrgO2OzEQ9ekxV0X0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)