UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LVLzGwM+SPNkuf0eNFo/isZbocLcWJpolRR5P1tMk4I=' 
WHERE 
  key_id = 'd827f9e458ab9904564c73b5d13671cf8b6bab9558bb6d44fc4b4667378026da' 
  AND (
    token = 'LVLzGwM+SPNkuf0eNFo/isZbocLcWJpolRR5P1tMk4I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038