UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rl8C61gJI3KtX8oLbxz3jhKnzmBNO6BFN6Nn/3v81X8=' 
WHERE 
  key_id = '493e7aff6f4e4d950cecfee7be7febc8e5711c5cc5bb9512e15eceb2308b444c' 
  AND (
    token = 'rl8C61gJI3KtX8oLbxz3jhKnzmBNO6BFN6Nn/3v81X8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031