UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'aoN1PM9kC6m8hyQQOyq/ByC1WD3qHiEFegBR850whrw=' 
WHERE 
  key_id = 'e01098b63916675070b6de1d09249227854ab294d406dd38e698ece3ca5aa2c6' 
  AND (
    token = 'aoN1PM9kC6m8hyQQOyq/ByC1WD3qHiEFegBR850whrw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026