UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kL8Q9AXwqNniYlSMwr3SwzxDoSF7Dxp83JQldb/2suM=' 
WHERE 
  key_id = '11b77a565ba803ba6681a0425686794bfe343099e3ac191fd75a3f4e105aaf5a' 
  AND (
    token = 'kL8Q9AXwqNniYlSMwr3SwzxDoSF7Dxp83JQldb/2suM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022