UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wdpB0PYVbiQHUlssRqqpMPjZtvp+soOZ6Jm54UjTqus=' 
WHERE 
  key_id = '26db761a12b92cda9f8cf699eaf5fd49d2c4b72d1360d5a3fd719652541077a8' 
  AND (
    token = 'wdpB0PYVbiQHUlssRqqpMPjZtvp+soOZ6Jm54UjTqus=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043