UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qSQQudmpd1GeiegV35uxMuLtuVV9sbtaqnpUTV/hYEo=' 
WHERE 
  key_id = 'fe125f8d7f31a7da39e56567c7450c8dd882203f2ddd15549f271c109350391d' 
  AND (
    token = 'qSQQudmpd1GeiegV35uxMuLtuVV9sbtaqnpUTV/hYEo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033