UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AXVr1zjUBnm95kdy8Q7HQ226K/E0iNL5QXYEsfxT390=' 
WHERE 
  key_id = '810c2c2c6f8913a091da4e8d5bade9d7e2ee97090fe8bac7fd1b202eb49f8798' 
  AND (
    token = 'AXVr1zjUBnm95kdy8Q7HQ226K/E0iNL5QXYEsfxT390=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026