UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+b9Bii9Aw7nhd2xirVt51EeZsWfMZZ7I0ukKDYhmB8Q=' 
WHERE 
  key_id = 'cdf35953d91f668caca49554bca1392d904723e36b151683320e8da9a4fff149' 
  AND (
    token = '+b9Bii9Aw7nhd2xirVt51EeZsWfMZZ7I0ukKDYhmB8Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019