UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HDjnJYOxuQWV7gEszBIg5C7uAD3JegciBvk/rlZ7A+A='
WHERE
key_id = '3db176ff2cd9d7a9b2cc56acb65ece58031b565472ccb793b8050a6bab7a5e67'
AND (
token = 'HDjnJYOxuQWV7gEszBIg5C7uAD3JegciBvk/rlZ7A+A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)