UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+5dCDzDEOyv0TVy3sZd62y3hQya8KK3bN4PfgwbB/hQ=' 
WHERE 
  key_id = '6a73525a7945423260b8870338a8831504901279935f81854a84574d47e8fe02' 
  AND (
    token = '+5dCDzDEOyv0TVy3sZd62y3hQya8KK3bN4PfgwbB/hQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033