UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Qy3hDnmXr8SYVkNqqd7LrBu0mkzxuzDABr9JJ846UfE=' 
WHERE 
  key_id = '148bd6d739102cb63a7374bd3141e5d20d5f60cf9e253307d6ad2af549bb5653' 
  AND (
    token = 'Qy3hDnmXr8SYVkNqqd7LrBu0mkzxuzDABr9JJ846UfE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032