UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MQL8EBETUdhXg2n3FC6c1fCiGgwUOIPhEqqj0xapqQk=' 
WHERE 
  key_id = 'c01f2cedaad62b820714c9c08648b023b3e35925a1d7a28196bb60a3303e278d' 
  AND (
    token = 'MQL8EBETUdhXg2n3FC6c1fCiGgwUOIPhEqqj0xapqQk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030