UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bKvYr4OsFslVNRxkeMNiCLHrRaR45eMk3NgnGzEfTwc=' 
WHERE 
  key_id = '04a0df51be3ab72690360974a5e352e5258bff71a64792bfb9e8e3823ad8cae2' 
  AND (
    token = 'bKvYr4OsFslVNRxkeMNiCLHrRaR45eMk3NgnGzEfTwc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031